/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ecom.client;
import ecom.beans.entity.Accounts;
import ecom.beans.entity.Address;
import ecom.beans.entity.Clients;
import ecom.beans.entity.Productstore;
import ecom.beans.entity.Produits;

/**
 *
 * @author Amina
 */
public class CommandLineReader {
    private static Clients clients;
    public static Produits getProduits() {
        Produits product = new Produits();
        System.out.print("Saisir le nom du produit: ");
        product.setName(Tx.readString());
        System.out.print("Saisir le nom en Englais: ");
        product.setName(Tx.readString());
        System.out.println("Saisir la description du produit: ");
        product.setDescription(Tx.readString());
        System.out.println("Saisir la description en englais: ");
        product.setDescription(Tx.readString());
        System.out.print("Saisir le prix du produit: ");
        product.setPrice(Tx.readDouble());
        System.out.print("Le produit est en promotion? Saisir Oui ou Non");
       
        return product;
    }

    public static int getProductCategory(String choixPossible){
        System.out.println(choixPossible);
        System.out.print("Saisir la catégorie du produit: ");
        return Tx.readInt();
    }

    public static Accounts getAccounts() {
        Accounts account = new Accounts();
        System.out.print("Enter Iban: ");
        account.setIban(Tx.readString());
        System.out.print("Enter Owner Name: ");
        account.setOwner(Tx.readString());
        System.out.print("Enter Balance: ");
        account.setBalance(Tx.readDouble());
        return account;
    }


    public static Productstore getProductstore(){
        Productstore productStore = new Productstore();
        productStore.setName(Tx.readString());
        return productStore;
    }

    public static Address getAddress(){
        Address address = new Address();
        System.out.print("Saisir le numero: ");
        address.setNumero(Tx.readInt());
        System.out.print("Saisir le nom de la rue: ");
        address.setRue(Tx.readString());
        System.out.print("Saisir le code postale: ");
        address.setCp(Tx.readInt());
        System.out.print("Saisir le nom de la ville: ");
        address.setPays(Tx.readString());
        return address;
    }

    static Clients getClients() {
        Clients clients = new Clients();
        clients = (Clients) getClients();
        System.out.print("Saisir le prenom: ");
        clients.setNom(Tx.readString());
        System.out.print("Saisir le nom: ");
        clients.setPrenom(Tx.readString());

        return clients;
    }
    }

